//
//  ZYCCheckVersionUpdateView.m
//  ZDSC
//
//  Created by ZDTX on 2021/10/8.
//

#import "ZYCCheckVersionUpdateView.h"
@interface ZYCCheckVersionUpdateView ()

@property (nonatomic, strong) UIView *top;
@property (nonatomic, strong) UIView *bottom;
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UIImageView *rightArrowImageView;
@end
@implementation ZYCCheckVersionUpdateView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self addSubview:self.top];
        [self addSubview:self.bottom];
        [self addSubview:self.titleLabel];
        [self addSubview:self.rightArrowImageView];
        
        [self.top mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.top.equalTo(self);
            make.height.mas_equalTo(1.0f);
        }];
        
        [self.bottom mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.bottom.equalTo(self);
            make.height.mas_equalTo(1.0f);
        }];
        
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(20.0f);
            make.centerY.equalTo(self);
        }];
        
        [self.rightArrowImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(self).offset(-20.0f);
            make.centerY.equalTo(self);
            make.size.mas_equalTo(CGSizeMake(7.0, 12.0f));
        }];
        
    }
    return self;
}

- (UIView *)top {
    if (!_top) {
        _top = [[UIView alloc] init];
        _top.backgroundColor = HEX_RGB(@"#F9F9F9");
    }
    return _top;
}

- (UIView *)bottom {
    if (!_bottom) {
        _bottom = [[UIView alloc] init];
        _bottom.backgroundColor = HEX_RGB(@"#F9F9F9");
    }
    return _bottom;
}

- (UILabel *)titleLabel {
    if (!_titleLabel) {
        _titleLabel = [UILabel LabelWithString:@"检查更新" Font:kCustomFont(@"PingFangSC-Regular", 18.0f) titleColor:HEX_RGB(@"#2B302D") textAlignment:ZZTextAlignmentLeft];
    }
    return _titleLabel;
}

- (UIImageView *)rightArrowImageView {
    if (!_rightArrowImageView) {
        _rightArrowImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"jt"]];
    }
    return _rightArrowImageView;
}

@end
